<template>
  <div>
    <Header></Header>
    <div style="background:#f6f6f6;width:100%;height:30px;"></div>
    <div class="classification">
      <div class="content">
        <div class="content_title" v-html="questiontitle"></div>
        <div class="content_new">
          <div class="new" v-for="(item,index) in questionList" :key="index" >
            <li >{{item.content}}</li>  
          </div>
          <!-- <div class="page">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"             
              layout="total, sizes, prev, pager, next, jumper"
              :total="40"
            ></el-pagination> -->
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Header from "@/common/Header/Header";
import qs from "qs";
export default {
  name: "questionlist",
  data() {
    return {
      questionIndex: 10,
      questionList: [],
      i: -1,
      id: "",
      p: 1,
      questionIndex: 10,
      ids: "",
      questiontitle:'',
      totalCount:'',
    };
  },
  methods: {
    // comment(item, index) {
    //   this.i = index;
    // },
    // cancel(item, index) {
    //   this.i = -1;
    // },
    //获取回复ID
    getmessage() {
      this.id = this.$route.query.comment_id;
      console.log(this.id);
    },
    //获取问题回复的评论
    getCommentList() {
      this.$axios
        .get(
          "api/App/User/Question/get_answers_comment?source_id=" +
            this.id +
            "&p=1&limit=" +
            this.questionIndex +
            "&member_id=" +
            this.getCookie("member_id"),
        )
        .then(res => {
          // console.log(res)
          this.questionList = res.data.data.list;
          this.questiontitle =res.data.data.answers;
          this.totalCount =res.data.data.count;
        });
    }
  },
  created() {
    this.getmessage();
    this.getCommentList();
  },
  components: {
    Header
  }
};
</script>
<style lang="scss" scoped>
.classification {
  width: 1170px;
  height: auto;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  .content {
    width: 70%;
    margin: 0 auto;
    text-align: left;
    .content_title {
      font-size: 18px;
      padding-left: 20px;
      margin-top: 20px;
      margin-bottom: 15px;
    }
    .content_new {
      width: 100%;
      border: 1px solid #666;
      padding: 20px;
      .new {
        list-style: none;
        li {
          width: 95%;
          height: auto;
          margin: 0 auto;
          border-bottom: 1px solid #666;
          margin-top: 10px;
          padding-bottom: 10px;
        }
      }
      .page {
        text-align: right;
        margin-top: 10px;
      }
    }
  }
}
</style>


